import java.util.Scanner;

public class digui {

    public static int get_sum(int n) {
        int sum=0;
        if(n<10) {sum=n;return sum;}
        return sum+get_sum(n/10);
    }
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int n= in.nextInt();
        int ret=get_sum(n);
        System.out.println(ret);
    }
/*
    public static int digui1(int i) {
        if(i==1)
            return 1;
        return i+digui(i-1);
    }
    public static void main1(String[] args) {
        int ret=digui(10);
        System.out.println(ret);
    }
*/
}

